 
<div class="block">
    <h4 class="vatlytrilieu">
        <a href="<?=$this->baseUrl("/")?>" >Home </a> &gt;  
        <a href="<?=$this->url(array("module"=>"default","controller"=>"cart","action"=>"index"))?>" >Cart</a> &gt; 
        Customer
    </h4>
    <div class="block_content">  
            <div class="info-frame">
                <?php if(!$this->isLogin){ ?>
                <form id="loginform" class="form" method="post" action="">
                    <fieldset>
                        <legend>I'm already a customer</legend>
                        <?php if(!empty($this->has_err)){?>
                        <p class="message error"><?=$this->has_err?></p>
                        <?php }?>
                        <p class="field">
                            <label>Username</label>
                            <input type="text" name="username" />
                        </p>
                        
                        <p class="field">
                            <label>Password</label>
                            <input type="password" name="password" />
                        </p>
                        
                        <p class="buttons">
                            <label>&nbsp;</label><input type="submit" value="Login" name="btnLogin" />
                        </p>
                        <p class="more">
                            <a href="registry.html">New customer</a> | <a href="quen-mat-khau.html">Forgot password!</a>
                        </p>
                    </fieldset>
                </form>       
            
                <?php }?>               
                
                
                <form id="formXacNhan" class="form" method="post" action="<?=$this->url(array("module"=>"default","controller"=>"cart","action"=>"process-order"))?>">
                
                        <fieldset>
                            <legend>Billing Information</legend>
                            <p class="field">
                                <label>Full name:</label>
                                <input class="size1" type="text" name="fullname" value="<?=$this->customer->fullname?>" />
                            </p>
                            
                            <p class="field">
                                <label>Phone:</label>
                                <input class="size1" type="text" name="phone" value="<?=$this->customer->phone?>" />
                            </p>
                            
                            <p class="field">
                                <label>Email:</label>
                                <input class="size2" type="text" name="email" value="<?=$this->customer->email?>" />
                            </p>
                            
                            <p class="field">
                                <label>Address:</label>
                                <input class="size2" type="text" name="address" value="<?=$this->customer->address?>" />
                            </p>
                            
                        </fieldset>
                        
                        <fieldset>
                            <p class='message error'></p>
                            <!-- Table-->
                            <?=$this->action("list","cart","default")?>
                            <!-- End Table -->

                        </fieldset>
                        <p class="buttons">
                            <input type="submit" value="Send Order" name="btnXacNhan" />
                            <input type="button" value="View Cart" onclick="window.location='/cart'" />
                        </p>
                    </form>   
            </div>      
            <!-- InstanceEndEditable -->
            </div>
</div>
<div class="dialog" title=""></div>
<script>
$(function(){
    var validate = $("#formXacNhan").validate({
            rules:{
                fullname:{
                    required: true,
                },
                email:{
                    required: true,
                },
                address:{
                    required: true,
                }
            },
            messages: {
                fullname:"Fullname is requied!",
                email:"Email is requied!",
                address:"Address is requied!",
            }
       });
       
       $("#formXacNhan").submit(function()
       {
            var num_item_cart = <?=$this->total?>;
            if(num_item_cart<=0)
            {
                $(".dialog").html("<p>You have not put anything into your cart.</p>")
                .dialog({
                    autoOpen: true,
                    modal: true,
                    title: "Confirm",
                    buttons:{
                        "Shop more": function(){
                            window.location = "<?=$this->baseUrl("/")?>";
                        },
                        "Go to Cart": function(){
                            window.location = "<?=$this->baseUrl("/cart")?>";
                        }
                    }
                });
                return false;
            }
            return true;
       });
})
</script>
    

